<div class="page-content">
	<div class="row">
		<div class="col-xs-12"> 
			<form name="userForm" id="userForm" novalidate="" action="{:U('Station/save_new')}" method="post"> 
				<input type="hidden" name="id" value="{$new_info['id']}">
				<div class="form-horizontal">
					<div class="form-group">
						<label class="col-sm-2 control-label no-padding-right margintop5" for="form-field-1"> 
							<i class="icon-asterisk light-red smaller-60 middle"></i>&nbsp;标题： 
						</label>
						<div class="col-sm-6">
							<div class="input-group col-xs-12 col-sm-12 ">
								<input type="text" id="title" name="title" class="form-control" value="{$new_info['title']}"/>
							</div>
							
						</div>
						<div class="help-block col-sm-4" >
							<span id="titleTip"></span>
						</div>
					</div>
					<div class="form-group">
						<label class="col-sm-2 control-label no-padding-right margintop5" for="form-field-1"> 
							<i class="icon-asterisk light-red smaller-60 middle"></i>&nbsp;内容： 
						</label>
						<div class="col-sm-9">
							<input type="hidden" id="content" name="content">
							<script id="editor" type="text/plain" style="width:100%;height:300px;"></script>
						</div>
					</div>

					
					
				
					<div id="alert_box"></div>
					<div class="clearfix form-actions">
						<div class="col-md-offset-2 col-md-9 col-sm-9">
							<button id="save" class="col-sm-2 btn btn-success" type="submit" >
								<i class="icon-save bigger-110"></i>
							 	<span id="submitbutton">保存</span>
							</button>
							<button class="col-sm-2 btn btn-default left10" type="button" id="cancle">
								<i class="icon-reply bigger-110"></i>
							 	<span id="submitbutton">取消</span>
							</button>
						</div>
					</div>
				</div>
			</form>
		</div>
	</div>
</div>

<script type="text/javascript" charset="utf-8" src="__PUBLIC__/dest/ueditor/ueditor.config.js"></script>
<script type="text/javascript" charset="utf-8" src="__PUBLIC__/dest/ueditor/ueditor.all.min.js"></script>
<script type="text/javascript" charset="utf-8" src="__PUBLIC__/dest/ueditor/lang/zh-cn/zh-cn.js"></script>
<script type="text/javascript">
	$(document).ready(function(){
		window.UEDITOR_HOME_URL = '__PUBLIC__/dest/ueditor/';
		var ue = UE.getEditor('editor');
		ue.addListener("ready", function () {
		    ue.setContent('{$new_info['content']}');

		});

		$.formValidator.initConfig({
			formid:"userForm",
			onerror:function(msg){
			},
			onsuccess:function(){
				if ($('#nav_image').val() == ''){
					$("#alert_box").jk_alert({msg: "请选择一个图标", type: 'danger', show_time: 8000});
                	return false;
				}
				$('#content').val(UE.getEditor('editor').getContent());
			}
		}); 
		$("#title").formValidator({empty:false, onshow:"请输入新闻标题", onfocus:"范围为[2-20]", oncorrect:" "})
		.functionValidator({fun:function(val,elem){
			if (val.length >= 2 && val.length <= 40){
				return true;
			}else{
				return 	'输入错误';
			}
		}});
		//status
		$('#cancle').click(function(){
			window.location.href = "{:U('Station/new_list')}";
		});
		
	});
</script>
				                
